/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package M30;

import java.util.Enumeration;
import java.util.Vector;

/**
 *
 * @author Administrator
 */



public class VectorDemo2 {
    public static void main(String[] args) {
        //实例化一个集合容器类，LinkedList，ArrayList，Vector，Set，Map
        //CRUD，针对容器类的操作，添加add，移除remove，检索get（index），修改set(index,newElement)
        
            Vector v = new Vector();
            
            v.add("第一");
            v.add(new Integer(1));
            v.add(new Double(1.1));
            
            v.add("第二");
            v.add(new Integer(2));
            v.add(new Double(2.2));
            
            System.out.println("V容器的内容是");
            System.out.println(v);
            
            System.out.print("V容器的容量是：");
            System.out.println(v.capacity()); 
            System.out.print("V中元素的个数：");
            System.out.println(v.size());
            
            Enumeration e = v.elements();
            while(e.hasMoreElements()){
                System.out.println(e.nextElement());
            }
            System.out.println("向量中第");
            System.out.println(v.elementAt(1));
         //   
           // List list = new LinkedList();
        //    Iterator i =list.iterator();
          //  while(i.hasNext()){
            //    integer tmp = (Integer)i.next();
            }
    }


